<!doctype html>
<html class="no-js" lang="">

<head>
    <!-- meta -->
    <meta charset="utf-8">
    <meta name="description" content="Flat, Clean, Responsive, admin template built with bootstrap 3">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
    <!-- /meta -->

    <title>心秘籍系统</title>



    <!-- core styles -->
    <link rel="stylesheet" href="__ROOT__/Public/asset/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="__ROOT__/Public/asset/css/font-awesome.min.css">
    <link rel="stylesheet" href="__ROOT__/Public/asset/css/animate.min.css">
    <!-- /core styles -->

    <!-- template styles -->
    <link rel="stylesheet" href="__ROOT__/Public/asset/css/style.1.css" id="font">

    <!-- template styles -->


    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <script src="__ROOT__/Public/asset/vendor/modernizr.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/css/groupQuizReport.css">
</head>

<!-- body -->
<body>

<div class="container">
    <header class="col-md-8 col-md-offset-2">
        <div class="title">
            <h2 align="center"><b>{$title}wippf分析集体报告</b></h2>
            <br><br><br>
            <h4 align="center" style="font-family: 微软雅黑;">原著：Wiesbadener</h4>
        </div>
    </header>
    <div class="col-md-10 col-md-offset-1"><hr/></div>
    <div class="col-md-6 col-md-offset-3"><p align="center"></p></div>
    <div class="col-md-10 col-md-offset-1 menu">
        <table width="100%">
            <tbody>
            <tr><td class="line"><div class="l b">wippf 测试结果</div> <div class="r">1</div></td></tr>

            </tbody>
        </table>
    </div>
    <div class="col-md-10 col-md-offset-1">
        <div class="main-header">测验背景介绍</div>

        <article>
            <p>WIPPF是威斯巴登积极心理人格能力调查表的缩写，是积极心理治疗的核心调查量表，它可以在一张表内测量出你的：
                19项能力所在
                冲突反应模式（面对压力和冲突时的反应倾向性）
                榜样模型（母亲、父亲、他人以及关系）
                社会行为倾向
                情感关系特点
                增强对自己的深入了解、进行深入自我挖掘的必备工具，如果和伙伴共同测试，更能看到双方的共同点、差异和分歧。</p>
        </article>
    </div>

    <div class="col-md-10 col-md-offset-1 ">
        <div class="main-header">所有用户得分列表</div>
    </div>

    <div class="col-md-12">
        <article>
            <table class="table table-striped">
                <thead>


                <tr>
                    <th>用户名</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>组织</th>
                    <foreach name="element_name" item="r">
                    <th>{$r}</th>
                    </foreach>
                </tr>
                </thead>
                <tbody id="tabledata-normal">

                <foreach name="result_table" item="userdata">
                <tr>
                    <td>{$userdata.username}</td>
                    <td>18</td>
                    <td>男</td>
                    <td>{$userdata.class}</td>

                    <foreach name="userdata['score_data']" item="score">
                    <td class="{$score.status}">
                        {$score.trans_score}
                    </td>
                    </foreach>

                </tr>
                    </foreach>
                </tbody>


            </table>
        </article>
    </div>


    <div class="col-md-10 col-md-offset-1">
        <div class="main-header">预警用户得分列表</div>
    </div>

    <div class="col-md-12">
        <article>
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>用户名</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>组织</th>
                    <foreach name="element_name" item="r">
                        <th>{$r}</th>
                    </foreach>
                </tr>
                </thead>
                <tbody>


                <foreach name="result_table" item="userdata">

                    <if condition="$userdata.warn eq 1">

                        <tr>
                            <td>{$userdata.username}</td>
                            <td>18</td>
                            <td>男</td>
                            <td>{$userdata.class}</td>

                            <foreach name="userdata['score_data']" item="score">
                                <td class="{$score.status}">
                                    {$score.trans_score}
                                </td>
                            </foreach>
                        </tr>

                    </if>



                </foreach>

                </tbody>


            </table>
        </article>
    </div>

</div>

</body>
<script src="__ROOT__/Public/asset/vendor/jquery-1.11.1.min.js"></script>
<script src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
<script src="__ROOT__/Public/asset/bootstrap/js/bootstrap.js"></script>
<script>

    $(document).ready(function(){

        var dataarr = [];


        var i = 0;
        $("#tabledata-normal").find('tr').each(function(){
            dataarr.push([]);
            $(this).find('td').each(function(){
                if ($(this).attr("class") == '1'){
                    $(this).addClass('danger')
                }
                var num = $(this).text();
                dataarr[i].push(num);
            });
            i ++;
        });


        var score = [];
        var k = 0;

            for (var tdi = 4; tdi <= 19; tdi++){
                for (var tri = 0; tri < dataarr.length; tri++){
                    if (!score[k])
                        score[k] = 0;
                    score[k] = parseInt(score[k]) + parseInt(dataarr[tri][tdi]);
                }
                k++;
            }


        for(i = 0; i < 16; i++ ){
            score[i] = score[i] / dataarr.length;
            score[i] = parseFloat(score[i].toFixed(1));
        }

        console.log(score);



        //alert($(".section_score:eq(0)").find('span:eq(1)').html());

        var section_score = new Array();

        for (var $i = 0; $i < 16; $i++){
            section_score[$i] = parseInt($(".section_score:eq("+$i+")").find('span:eq(1)').html());
        }

        console.log(section_score);


    });




</script>


